<template>
	<view class="content">
		<text style="font-size:50rpx;">子组件A</text>
		<view class="coma_box">
			<text>父组件传进来的值:</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()">传值给compB组件</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'],
		name: "comA",
		data() {
			return {

			};
		},
		methods: {
			sendData() {
				this.$emit('sendToB', this.intent)
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #fbb034;
		padding: 30rpx;
		border-radius: 12rpx;
		margin-bottom: 30rpx;
	}

	.content text {
		font-size: 50rpx;
		font-weight: bold;
		margin-bottom: 20rpx;
	}

	.coma_box {
		display: flex;
		align-items: center;
		margin-bottom: 20rpx;
	}

	.coma_box text {
		margin-right: 10rpx;
		font-size: 32rpx;
	}

	button {
		padding: 12rpx 24rpx;
		border-radius: 8rpx;
	}
</style>